package com.xiongwei.mediator;

import java.util.HashMap;
import java.util.Map;

/**
 * @author XiongWei
 * @date 2024/2/1
 */
public class ConcreteMediator extends Mediator{

    private Map<String, AbstractColleage> colleageMap = new HashMap<>();

    @Override
    public void register(String name, AbstractColleage colleage) {

    }

    @Override
    public void getMessage(int stateChange, String name) {
        if (colleageMap.get(name) instanceof Alarm) {
            if (stateChange == 0) {

            }
            ((Alarm) colleageMap.get(name)).sendAlarm(stateChange);
        }
    }
}
